package com.yuyou.activity.comm.service.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.activity.comm.service.entity.PayRefundTrade;
import com.yuyou.activity.comm.service.mapper.PayRefundTradeMapper;
import com.yuyou.activity.comm.service.service.IPayRefundTradeService;
import com.yuyou.activity.util.bean.ResBoolSimpleInfo;
import com.yuyou.activity.util.util.Sequence;

@Service
public class PayRefundTradeServiceImpl implements IPayRefundTradeService{

	@Autowired
	private PayRefundTradeMapper payRefundTradeMapper;
	
	@Override
	public int deleteByPrimaryKey(Long payRefundTradeId) {
		return payRefundTradeMapper.deleteByPrimaryKey(payRefundTradeId);
	}

	@Override
	public int insert(PayRefundTrade record) {
		record.setPayRefundTradeId(Sequence.getSequence().nextId());
		record.setCreateTime(new Date());
		return payRefundTradeMapper.insert(record);
	}

	@Override
	public PayRefundTrade selectByPrimaryKey(Long payRefundTradeId) {
		return payRefundTradeMapper.selectByPrimaryKey(payRefundTradeId);
	}

	@Override
	public int updateByPrimaryKeySelective(PayRefundTrade record) {
		return payRefundTradeMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public ResBoolSimpleInfo<String> add(PayRefundTrade record) {
		this.insert(record);
		return ResBoolSimpleInfo.getSuccessInfo();
	}
	
}